package com.skywolf.chem.usercenter.controller;


import com.skywolf.chem.common.sysconfig.response.RespData;
import com.skywolf.chem.usercenter.pojo.vo.PermissionVO;
import com.skywolf.chem.usercenter.service.IPermissionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 权限表 前端控制器
 * </p>
 *
 * @author
 * @since 2019-12-02
 */
@RestController
@RequestMapping("/usercenter/permission")
@Api(value = "权限API", description = "权限API")
public class PermissionController {

    @Autowired
    private IPermissionService permissionService;

    @GetMapping(value = "/all")
    @ApiOperation(value = "获取系统权限列表")
    public RespData<List<PermissionVO>> listPermissionsTree() {
        List<PermissionVO> voList = permissionService.listPermissionsTree();
        return RespData.success(voList);
    }
}
